flowchart TD
  subgraph sg0["Case 1"]
    direction TB
    n0["Before"]
    subgraph sg1["If"]
      direction TB
      n1{"If"}
      class n1 decisionNode;
      n2["After"]
    end
  end
  subgraph sg2["Case 2"]
    direction TB
    n5["After"]
    subgraph sg3["Before"]
      direction TB
      subgraph sg4["If"]
        direction TB
        n3{"If"}
        class n3 decisionNode;
        n4["Then"]
      end
    end
  end
  subgraph sg5["Case 3"]
    direction TB
    n6["Before"]
    subgraph sg6["If"]
      direction TB
      n7{"If"}
      class n7 decisionNode;
      n8["Then"]
      n9["After"]
    end
  end
  n1 --> n2
  n3 --> n4
  n7 --> n8
  n8 --> n9
  n0 --> n1
  n4 --> n5
  n6 --> n7
%%__BAML_SPANMAP__={"n0":{"file_path":"tests/validation_files/headers/if_then_only_header.baml","start_line":4,"start":4,"end_line":4,"end":15},"n1":{"file_path":"tests/validation_files/headers/if_then_only_header.baml","start_line":6,"start":4,"end_line":6,"end":10},"n2":{"file_path":"tests/validation_files/headers/if_then_only_header.baml","start_line":9,"start":4,"end_line":9,"end":14},"n3":{"file_path":"tests/validation_files/headers/if_then_only_header.baml","start_line":20,"start":4,"end_line":20,"end":12},"n4":{"file_path":"tests/validation_files/headers/if_then_only_header.baml","start_line":22,"start":8,"end_line":22,"end":17},"n5":{"file_path":"tests/validation_files/headers/if_then_only_header.baml","start_line":26,"start":4,"end_line":26,"end":14},"n6":{"file_path":"tests/validation_files/headers/if_then_only_header.baml","start_line":34,"start":4,"end_line":34,"end":16},"n7":{"file_path":"tests/validation_files/headers/if_then_only_header.baml","start_line":38,"start":4,"end_line":38,"end":10},"n8":{"file_path":"tests/validation_files/headers/if_then_only_header.baml","start_line":40,"start":8,"end_line":40,"end":17},"n9":{"file_path":"tests/validation_files/headers/if_then_only_header.baml","start_line":44,"start":4,"end_line":44,"end":14}}
  click n0 call bamlMermaidNodeClick() "Go to source"
  click n1 call bamlMermaidNodeClick() "Go to source"
  click n2 call bamlMermaidNodeClick() "Go to source"
  click n3 call bamlMermaidNodeClick() "Go to source"
  click n4 call bamlMermaidNodeClick() "Go to source"
  click n5 call bamlMermaidNodeClick() "Go to source"
  click n6 call bamlMermaidNodeClick() "Go to source"
  click n7 call bamlMermaidNodeClick() "Go to source"
  click n8 call bamlMermaidNodeClick() "Go to source"
  click n9 call bamlMermaidNodeClick() "Go to source"